<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title></title>
  <style type="text/css">

    .super-link {
      position: relative;
      text-decoration: none;
      color: #000;
    }

    /*伪元素是两个冒号*/
    .super-link::after {
      content: '';

      width: 100%;
      height: 1px; /*设置伪元素的高度，这里是下划线的粗细*/
      position: absolute;
      top: 100%;
      left: 0;

      background-color: currentColor; /*当前标签继承的文字颜色，这里让伪元素的背景色与父元素的文字颜色相同*/
      transform: scale(0);
      transition: all .35s;
    }

    .super-link:hover::after {
      transform: scale(1);
    }

    .left::after {
      transform-origin: left;
    }

    .right::after {
      transform-origin: right;
    }

    .center::after {
      transform-origin: center;
    }

  </style>
</head>

<body>


<a href="#" class="super-link center">
  动态下划线中间伸展
</a>
<a href="#" class="super-link left">
  动态下划线左边伸展
</a>

<a href="#" class="super-link right">
  动态下划线右边伸展
</a>
</body>

</html>